package com.dalin.platform.loa.action;

import javax.servlet.http.Cookie;

import com.dalin.framework.action.StrutsTwoAction;

/*****************************************************************************
 * @content: 安全退出                                                                                                                              *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2010-03-02                                                     *
 ****************************************************************************/
public class LogoutAction extends StrutsTwoAction {
	public String execute() throws Exception {
		super.printInfo("", "===== this action begin");
		getReq().getSession(false).invalidate();
		Cookie[] cooks = getReq().getCookies();
		for (Cookie c : cooks) {
			c.setValue(null);
			c.setMaxAge(0);
			getRes().addCookie(c);
		}
		setResContent(true, "");
		super.printInfo("", "===== this action end");
		return null;
	}
}
